package com.twu.biblioteca.command;

import com.twu.biblioteca.domain.LibraryService;
import com.twu.biblioteca.model.Movie;

public class ReturnMovieCommand extends Command {


    private LibraryService libraryService;
    private String movieId;

    public ReturnMovieCommand(LibraryService libraryService) {
        this.libraryService = libraryService;
    }

    @Override
    public String execute() {
        Movie movie = (Movie) libraryService.returnMovie(movieId);
        return MessageFactory.wrapReturnMovie(movie);
    }

    @Override
    public void parameter(String[] args) {
        movieId = args[0];
    }

    @Override
    public boolean hasSubParam() {
        return true;
    }

    @Override
    public String subParamTips() {
        return "please input movie id you want return";
    }

    public String getMovieId() {
        return movieId;
    }
}
